// miniprogram/pages/courseList/courseList.js


const courseCoverDictList = [
  {
    pic: "../../images/beiwa_s.jpg",
    charExample: "天·地·人",
    stagePre: "一年级",
    stageSuffix: "（上）",
    stageindex: 0,
  },
  {
    pic: "../../images/beiwa_s.jpg",
    charExample: "赵·钱·孙",
    stagePre: "一年级",
    stageSuffix: "（下）",
    stageindex: 1,
  },
  {
    pic: "../../images/beiwa_s.jpg",
    charExample: "桐·雀·鼓",
    stagePre: "二年级",
    stageSuffix: "（上）",
    stageindex: 2,
  },
  {
    pic: "../../images/beiwa_s.jpg",
    charExample: "龙·凤·府",
    stagePre: "二年级",
    stageSuffix: "（上）",
    stageindex: 3,
  },
  {
    pic: "../../images/beiwa_s.jpg",
    charExample: "丰·饶·诵",
    stagePre: "三年级",
    stageSuffix: "（上）",
    stageindex: 5,
  },
  {
    pic: "../../images/beiwa_s.jpg",
    charExample: "慧·芬·芳",
    stagePre: "生僻字",
    stageSuffix: "（进阶）",
    stageindex: 5,
  },
];

Page({

  /**
   * 页面的初始数据
   */
  data: {
    courseCoverDictList,
  },

  onCourseSelected(event){
    console.log("59-59 event:", event);
    const stageindex = event.currentTarget.dataset.stageindex;
    const courseUrl = `/pages/coursePage/coursePage?stageindex=${stageindex}`;
    wx.navigateTo({
      url: courseUrl,
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})